package com.code.jvm.reference.weak;

import java.lang.ref.WeakReference;

public class WeakClient {

    public static void main(String[] args) {
        WeakReference<byte[]> weakReference = new WeakReference<>(new byte[1]);
        System.out.println(weakReference.get());
        //只要触发垃圾回收，弱引用引用的对象就会被垃圾回收
        System.gc();
        System.out.println(weakReference.get());
    }
}
